package cn.com.guanying.android.ui;

import java.util.ArrayList;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;
import cn.com.guanying.R;
import cn.com.guanying.android.ui.adapter.NearbyCinemaAdapter;
import cn.com.guanying.javacore.v11.models.CinemaInfo;
/**
 * 附近影院
 * @author 赵庆普
 *
 */
public class NearbyCinemaActivity extends BaseActivity implements OnClickListener{
	
	private ListView mNearbyCinemaList;
	private NearbyCinemaAdapter mNearbyCinemaAdapter;
	public void doInit() {
		mTitleLeftButton.setText("返回");
		mTitleLeftButton.setOnClickListener(this);
		mTitleContent.setText("武侠");
		mTitleRigthButton.setText("全部");
		mTitleRigthButton.setOnClickListener(this);
		
		mNearbyCinemaAdapter = new NearbyCinemaAdapter(this);
		ArrayList<CinemaInfo> mCinemas = new ArrayList<CinemaInfo>();
		CinemaInfo cif = new CinemaInfo();
		mCinemas.add(cif);
		mCinemas.add(cif);
		mCinemas.add(cif);
		mCinemas.add(cif);
		mNearbyCinemaAdapter.setmCinemas(mCinemas);
		mNearbyCinemaList.setAdapter(mNearbyCinemaAdapter);
	}

	@Override
	public void doFindView() {
		mNearbyCinemaList = (ListView)findViewById(R.id.nearby_cinema);
		mTitleLeftButton = (Button)findViewById(R.id.left_title_button);
		mTitleContent = (TextView)findViewById(R.id.title_content);
		mTitleRigthButton = (Button)findViewById(R.id.right_title_button);
		mTitleLeftButton.setVisibility(View.VISIBLE);
		mTitleContent.setVisibility(View.VISIBLE);
		mTitleRigthButton.setVisibility(View.VISIBLE);
	}

	@Override
	protected int getContentView() {
		return R.layout.activity_nearby_cinema;
	}
	public void onClick(View v) {
		if(v.getId()==R.id.left_title_button){
			finish();
		}else if(v.getId()==R.id.right_title_button){
			finish();
		}
	}
	@Override
	protected void onLogicEventUI(Object sender, int eventId, Object[] datas) {
		// TODO Auto-generated method stub

	}

}
